<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./lib/vue-2.5.9.js"></script>
</head>

<body>
  <div id="app">
    <input type="button" value="点击获取元素的内容" @click="getInfo" ref="btn">
    <!-- ref     reference -->
    <h3 ref="myh3">{{ msg }}</h3>
  </div>

  <script>
    // 创建 Vue 实例，得到 ViewModel
    var vm = new Vue({
      el: '#app',
      data: {
        msg: '000'
      },
      methods: {
        getInfo() { // 点击按钮，获取 h3 中的文本内容
          // console.log(document.getElementById('myh3').innerHTML)
          // ref  属性
          console.log(this.$refs.myh3.innerHTML)
        }
      }
    });
  </script>
</body>

</html>